<?php
/* @var $this OnlinenewsController */
/* @var $model OnlineNews */
/* @var $form CActiveForm */
Yii::app()->clientScript->registerCssFile(Yii::app()->request->baseUrl.'/backend/imgareaselect/css/imgareaselect-animated.css');
Yii::app()->clientScript->registerScriptFile(Yii::app()->request->baseUrl.'/backend/imgareaselect/js/jquery.imgareaselect.pack.js');
Yii::app()->clientScript->registerScriptFile(Yii::app()->request->baseUrl.'/ckeditor/ckeditor.js');
Yii::app()->clientScript->registerScriptFile(Yii::app()->request->baseUrl.'/ckeditor/config.js');
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'online-news-form',
	// Please note: When you enable ajax validation, make sure the corresponding
	// controller action is handling ajax validation correctly.
	// There is a call to performAjaxValidation() commented in generated controller code.
	// See class documentation of CActiveForm for details on this.
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>
   <div class="row">
   
      <?php 
         $all_cate = Category::model()->getAll();
         $tree_cate = Category::model()->getTree($all_cate,0,array());
      ?>
		<?php echo $form->labelEx($model,'online_news_category_id'); ?>
		<?php echo $form->dropDownList($model,'online_news_category_id',$tree_cate); ?>
		<?php echo $form->error($model,'online_news_category_id'); ?>
	</div>
	<div class="row">
		<?php echo $form->labelEx($model,'title'); ?>
		<?php echo $form->textField($model,'title',array('size'=>60,'maxlength'=>1500)); ?>
		<?php echo $form->error($model,'title'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'summary'); ?>
		<?php echo $form->textArea($model,'summary',array('size'=>60,'maxlength'=>3000)); ?>
		<?php echo $form->error($model,'summary'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'html_content'); ?>
		<?php echo $form->textArea($model,'html_content'); ?>
		<?php echo $form->error($model,'html_content'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'content'); ?>
		<?php echo $form->textArea($model,'content'); ?>
		<?php echo $form->error($model,'content'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'datetime'); ?>
		<?php echo $form->textField($model,'datetime'); ?>
		<?php echo $form->error($model,'datetime'); ?>
	</div>

	


	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->

<script>
   $(document).ready(function(){
      CKEDITOR.replace('OnlineNews_content');
   })
</script>